package com.dc.toolkit.hutool.core;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.RandomUtil;
import org.junit.Test;

import java.math.BigDecimal;
import java.security.SecureRandom;

/**
 * Description: Hutool RandomUtil Demo
 * @author: gdc
 * @date: 2021/4/24
 * @version 1.0
 */
public class RandomUtilTest {

    /**
     * 测试
     */
    @Test
    public void test(){
        System.out.println(RandomUtil.randomInt());
        System.out.println(RandomUtil.randomInt(10));
        System.out.println(RandomUtil.randomInt(50, 60));


        System.out.println(RandomUtil.randomLong());
        System.out.println(RandomUtil.randomLong(10));
        System.out.println(RandomUtil.randomLong(50, 60));

        System.out.println(RandomUtil.randomDouble());
        System.out.println(RandomUtil.randomDouble(10));
        System.out.println(RandomUtil.randomDouble(50, 60));

        System.out.println(RandomUtil.randomBigDecimal());
        System.out.println(RandomUtil.randomBigDecimal(BigDecimal.valueOf(10)));
        System.out.println(RandomUtil.randomBigDecimal(BigDecimal.valueOf(50), BigDecimal.valueOf(60)));

        System.out.println(RandomUtil.randomString(10));
        System.out.println(RandomUtil.randomString("今天天气阴天有风感觉很冷", 4));


        DateTime dateTime = RandomUtil.randomDay(1, 10);
        System.out.println(dateTime);


        SecureRandom secureRandom = RandomUtil.getSecureRandom();
        System.out.println(secureRandom);
    }
}
